using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MMM.Core.Domain;
using ServiceStack.ServiceHost;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using MMM.Services.Type;
using MMM.Services.Response;


namespace MMM.Services.Operations
{
    /// <summary>
    /// 委托产品管理 GET获取操作映射类
    /// </summary>
    [Route("/api/agentproduct", "GET")]
    public class AgentProductPageGet : PageGet<AgentProductPageGet>
    {
        //public string Name { get; set; }
    }
    /// <summary>
    /// 委托产品管理 DELETE操作映射类
    /// </summary>
    [Route("/api/agentproduct", "DELETE")]
    public class AgentProductDelete : Base.DeleteOperation<Guid?>
    {
    }

    [Route("/api/agentproductList", "POST")]
    public class AgentProductList : List<AgentProductDto>
    {

    }

    [Route("/api/agentproduct2", "GET")]
    public class AgentProductDto : AgentProduct
    {
        public bool IsChecked { get; set; }

        public AgentProduct ToAgentProduct()
        {
            return new AgentProduct
            {
                AgentId = this.AgentId,
                AgentName = this.AgentName,
                City = this.City,
                CityCode = this.CityCode,
                Id = this.Id,
                Price = this.Price,
                Product = this.Product,
                ProductId = this.ProductId
            };
        }
    }

    [Serializable]
    [Route("/api/agentProductTree", "GET")]
    public class AgentProductTreeNode : JsonNode<AgentProductTreeNode>
    {
        /// <summary>
        /// 可覆盖城市
        /// </summary>
        [StringLength(50)]
        public String City { get; set; }
        /// <summary>
        /// 城市编号
        /// </summary>
        [StringLength(50)]
        public String CityCode { get; set; }
    }
}
